package com.brogent.shapes;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Point;
import android.view.MotionEvent;

public abstract class Shape {

    public static final byte CLEAR          = 0x00;
    public static final byte PEN            = 0x01;
    public static final byte LINE           = 0x02;
    public static final byte RECTANGLE      = 0x03;
    public static final byte CIRCLE         = 0x04;

    protected boolean        isFirstDraw    = true;
    protected Point          mStartPt       = new Point(0, 0);
    protected Point          mEndPt         = new Point(0, 0);
    protected Point          mPreviousEndPt = new Point(0, 0);

    public void addPoint() {
        return;
    }

    public void addStartPoint(int x, int y) {
        this.mStartPt.set(x, y);
    }

    public void addEndPoint(int x, int y) {
        this.mEndPt.set(x, y);
    }

    public abstract void draw(Canvas canvas, Paint paint, MotionEvent event);

    public void onDraw(Canvas canvas, Bitmap bitmap) {
        canvas.drawBitmap(bitmap, 0, 0, null);
        isFirstDraw = true;
    }
}
